"use strict";
import * as React from 'react';
import { autoSize, commonStyles } from "../assets/styles/common";
import Avatar from "./Avatar";
import MyText from "./MyText";
import Request from "../utils/Request";
const { View, Text } = require('react-native');
const { connect } = require('react-redux');
class ProductItem extends React.Component {
    constructor(props, context) {
        super(props, context);
    }
    render() {
        return (<View style={[commonStyles.flexRow, { padding: 10 }]}>
                <Avatar source={{ uri: Request.checkImageUrl(this.props.get_order_product.preview) }} size={autoSize(75)} circle={false}/>
                <View style={[commonStyles.flexColumn, {
                padding: 10,
                flex: 1,
                justifyContent: 'space-around'
            }]}>
                    <View>
                        <MyText>{this.props.get_order_product.name}</MyText>
                        <MyText>{this.props.get_order_product.spec}</MyText>
                    </View>
                    <View style={[commonStyles.flexRow, { justifyContent: 'space-between' }]}>
                        <MyText>{`¥ ${Number(this.props.price).toFixed(2)}`}</MyText>
                        <MyText>{`x ${this.props.count}`}</MyText>
                    </View>
                </View>
            </View>);
    }
}
export default ProductItem;
